package com.mall.user.dao;

import com.mall.entity.TbUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * 用户映射器
 *
 * @author ASUS
 * @date 2021/07/18
 */
@Mapper
public interface UserMapper {

    /**
     * 找到一个接电话
     *
     * @param consumer 消费者
     * @return {@link consumer}
     */
    TbUser findOneByTel(TbUser consumer);

    /**
     * 插入
     *
     * @param user 用户
     */
    void insert(TbUser user);

    /**
     * 更新
     *
     * @param u u
     */
    void update(@Param("u") TbUser u);

    TbUser findUserById(String userId);

    void updateAccumulativeTotalByUid(@Param("uid") Long uid,@Param("rechargeAmount") BigDecimal rechargeAmount);

    TbUser selectTel(String tel);
}
